<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>common_util: 1. Build and Run</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">common_util
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

</div><!-- top -->
<div><div class="header">
  <div class="headertitle"><div class="title">1. Build and Run</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><a class="anchor" id="autotoc_md10"></a> </p>
<h1><a class="anchor" id="autotoc_md11"></a>
1.1. Windows</h1>
<h2><a class="anchor" id="autotoc_md12"></a>
1.1.1. Modify Scripts</h2>
<p><b>1.1 Set the Generator</b></p>
<p>Open the ./script/build.bat file and replace the following line:</p>
<div class="fragment"><div class="line">set generator=&quot;Visual Studio 14 2015&quot;</div>
</div><!-- fragment --><p>with the corresponding version of Visual Studio installed on your machine. It can be one of the following values:</p>
<div class="fragment"><div class="line">Visual Studio 14 2015</div>
<div class="line">Visual Studio 15 2017</div>
<div class="line">Visual Studio 16 2019</div>
<div class="line">Visual Studio 17 2022</div>
</div><!-- fragment --><p>You can use the <code>cmake -G</code> command to view more supported generators.</p>
<p><b>1.2 Set the Number of CPU Cores</b></p>
<p>Open the ./script/build.bat file and replace the following line:</p>
<div class="fragment"><div class="line">set cpu_cores=6</div>
</div><!-- fragment --><p>with the number of CPU cores on your machine.</p>
<p>To check the number of CPU cores:</p>
<div class="fragment"><div class="line">1. Open cmd, then input:</div>
<div class="line">wmic</div>
<div class="line">2. Input:</div>
<div class="line">cpu get NumberOfCores</div>
</div><!-- fragment --><p><img src="https://gitee.com/spencer_luo/common_util/raw/master/docs/quick_start/imgs/win_cpu_core_num.png" alt="" class="inline"/></p>
<h2><a class="anchor" id="autotoc_md13"></a>
1.1.2. Compilation</h2>
<div class="fragment"><div class="line">./script/build.bat build [x86|x64] [release|rls|debug|dbg]</div>
<div class="line"># Debug模式</div>
<div class="line"># ./script/build.bat build dbg</div>
</div><!-- fragment --><ul>
<li>Argument 1: Platform type of the target program to build, x86 means 32-bit program, and x64 means 64-bit program.</li>
<li>Argument 2: Configuration type of the target program to build, release or rls means the release version, and debug or dbg means the debug version.</li>
</ul>
<h2><a class="anchor" id="autotoc_md14"></a>
1.1.3. Run</h2>
<p>Run the results compiled in step 2.</p>
<div class="fragment"><div class="line">./script/build.bat run</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md15"></a>
1.1.4. Clean Cache</h2>
<p>Clear the cache from the compilation in step 2.</p>
<div class="fragment"><div class="line">./script/build.bat clean</div>
</div><!-- fragment --><h1><a class="anchor" id="autotoc_md16"></a>
1.2. Unix-like</h1>
<p>Including Linux/macOS and other Unix-like systems.</p>
<h2><a class="anchor" id="autotoc_md17"></a>
1.2.1. Compilation</h2>
<div class="fragment"><div class="line">./script/build.sh build [release|rls|debug|dbg]</div>
<div class="line"># Debug模式</div>
<div class="line"># ./script/build.sh build dbg</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md18"></a>
1.2.2. Run</h2>
<p>Run the results compiled in step 1.</p>
<div class="fragment"><div class="line">./script/build.sh run</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md19"></a>
1.2.3. Clean Cache</h2>
<p>Clear the cache from the compilation in step 1.</p>
<div class="fragment"><div class="line">./script/build.sh clean</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
